package 和为k的子数组;

import java.util.ArrayList;
import java.util.HashSet;
//暴力解法
public class Solution1 {
    public int subarraySum(int[] nums, int k) {
        int i = 0;
        int j =0;
        int count =0;
        for (int i1 = 0; i1 < nums.length; i1++) {
            int sum = 0;
            for(int j1=i1; j1 < nums.length; j1++){
                sum += nums[j1];
                if(sum == k) {
                    count++;
                }
            }
        }
        return count;
    }
}
